/*
using System;
using System.Collections;
using System.Drawing;
using Geometry;
using FIRADriverLibrary;
using AGHFiraPlayer;

namespace AGHFiraPlayer
{
	/// <summary>
	/// 
	/// </summary>
	public class TheCoachOf3
	{
		private const double robotDiameter = 0.1;

		private RobotController goalkeper;
		private RobotController defender;
		private RobotController attacker;

		private ArrayList oponents;

		private FIRADriver firaDriver;
		private RectangleF pitchArea;
		private double goalWidth;

		private double goalStartY, goalEndY;


		private GameState gameState = GameState.Off;
		public GameState GameState 
		{
			get { return gameState; }
			set {gameState = value; }
		}


		public TheCoachOf3(FIRADriver firaDriver, RectangleF pitchArea, double goalWidh)
		{
			this.pitchArea = pitchArea;
			this.goalWidth = goalWidh;
			this.firaDriver = firaDriver;
			this.oponents = new ArrayList();
			foreach (FIRARobotState robot in firaDriver.firaRobots)
			{
				if (robot.owned)
				{
					if (goalkeper == null)
						goalkeper = new RobotController(robot);
					else if (defender == null)
						defender = new RobotController(robot);
					else if (attacker == null)
						attacker = new RobotController(robot);
				}
				else 
					oponents.Add(robot);
			}
			if (attacker == null)
				throw new Exception("Too few robots owned - cannot initialize TheCoachOf3");

			goalStartY = pitchArea.Top + pitchArea.Height / 2 - goalWidh / 2 ;
			goalEndY = goalStartY + goalWidh ;

			goalkeper.startupPosition = new Point2D(pitchArea.Left + robotDiameter, pitchArea.Top + pitchArea.Height / 2);
			defender.startupPosition = new Point2D(pitchArea.Left + pitchArea.Width/2 - robotDiameter * 2, pitchArea.Top + pitchArea.Height / 2 - robotDiameter);
			attacker.startupPosition = new Point2D(pitchArea.Left +  pitchArea.Width/4, pitchArea.Top + pitchArea.Height / 2 + robotDiameter);

		}

		public void Refresh()
		{
			if (gameState == GameState.Off)
			{
				goalkeper.Stop();
				defender.Stop();
				attacker.Stop();
			}

			if (gameState == GameState.StartupPositions)
			{
				double distance = goalkeper.Position.GetDistance(goalkeper.startupPosition);
                if (distance > robotDiameter)
                    ;//commened in order to compile project
                    //PotencialDriver.DriveETA(goalkeper, goalkeper.startupPosition.x, goalkeper.startupPosition.y, distance / PotencialDriver.tinyVelocity);
                else
                    goalkeper.Stop();
				distance = defender.Position.GetDistance(defender.startupPosition);
				if (distance > robotDiameter)
                    ;//commened in order to compile project
					//PotencialDriver.DriveETA(defender, defender.startupPosition.x, defender.startupPosition.y, distance / PotencialDriver.tinyVelocity);
				else 
					defender.Stop();
				distance = attacker.Position.GetDistance(attacker.startupPosition);
				if (distance > robotDiameter)
                    ;//commened in order to compile project
					//PotencialDriver.DriveETA(attacker, attacker.startupPosition.x, attacker.startupPosition.y, distance / PotencialDriver.tinyVelocity);
				else 
					attacker.Stop();
			}

			if (gameState == GameState.Play)
			{
				Goalkeeper();
				if (firaDriver.ballX < pitchArea.Left + pitchArea.Width/2)
				{
					if (Predicator.VX < 0)
					{
						DefendAll();
					}
					else
					{
						//PassAndPrepareToAttack();
					}
				}
			}
		}


		private void DefendAll()
		{
			double attackerDistance = attacker.Position.GetDistance(firaDriver.ballX, firaDriver.ballY);
			double defenderDistance = defender.Position.GetDistance(firaDriver.ballX, firaDriver.ballY);

			double smallerDistance = Math.Min(attackerDistance, defenderDistance);

			double eta = smallerDistance / PotencialDriver.maxVelocity;
			Point2D ballAtETA = Predicator.GetBallPosition(eta); 

			attackerDistance = ballAtETA.GetDistance(attacker.robotState.x, attacker.robotState.y);
			defenderDistance = ballAtETA.GetDistance(defender.robotState.x, defender.robotState.y);

			smallerDistance = Math.Min(attackerDistance, defenderDistance);

			RobotController kicker, helper;
			if (attackerDistance < defenderDistance)
			{
				kicker = attacker;
				helper = defender;
			}
			else
			{
				kicker = defender;
				helper = attacker;
			}

			MoveToKickingPositionAndKick(kicker);
		}

		private void MoveToKickingPositionAndKick(RobotController robotController)
		{
			if (IsClearKickingPosition(robotController))
			{
				Kick(robotController);
				return;
			}




		}


		private bool IsClearKickingPosition(RobotController robotController)
		{
			return false;


		}

		private void Kick(RobotController robotController)
		{

		}



		private void Goalkeeper()
		{
			// goalkeeper
			PotencialDriver.DriveBlind(goalkeper, goalkeper.startupPosition.x, 
				Math.Max(goalStartY, Math.Min(goalEndY, firaDriver.ballY)), 0.4);

		}

	}
}
*/